home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / comms / commo60.zip / MOSTHOST.MAC < prev    next >
Text File  |  1994-04-09  |  26KB  |  795 lines

  1.                              MOSTHOST.MAC
  2.  
  3.    by Shad Muegge,
  4.    {COMMO} registration number 24
  5.  
  6. {:setup}                          * Set up MOSTHOST options
  7. -------------------------------------------------------------------------------
  8. -Configuration Items--------------Description----------------------------------
  9. -------------------------------------------------------------------------------
  10.  {LIGH Y}                         Modem signal lights
  11.  {SETV dospassword,PASSWORD}      Password to access the DOS menu
  12.  {SETV filedir,%_home%MHFILE\}    Directory for file transfer files
  13.  {SETV datadir,%_home%MHDATA\}    Directory for host data files (passwords)
  14.  {SETV hotkeys,n}                 Hot keys (y/n)
  15.  {SETV autobaud,n}                Autobaud (set to no for locked serial port)
  16.  {SETV inact_time,120}            Inactivity timer, seconds, 0=none
  17.  {SETV attention_string,AT|}      String to get the modem's attention
  18.  {SETV ring_string,RING}          String sent from modem to indicate a ring
  19.  {SETV connect_string,CONNECT}    Result string for a successfull connection
  20. -------------------------------------------------------------------------------
  21.  
  22.         {SETV pr_alarm,0}                   * Turn off protocol alarms
  23.         {SETV pr_down,%filedir}             * Protocol download path
  24.         {SETV pr_up,%filedir}               * Protocol upload path
  25.         {CLEA}
  26.         {LOCA n}
  27.         {SPOC y}
  28.         {DISP 1,1,7,Setup|}
  29.         {SETE WF5}
  30.         {SEND %attention_string}            * Make sure the PARAM takes effect
  31.  
  32.         {IFEX %datadir%DATA.MHS,ST2}        * Check for data file
  33.         {SETV userno,0}
  34.         {CALL write_data}
  35. {:ST2}
  36.         {local y}
  37.         {RETURN}
  38.  
  39. --------------------------------------------* General functions ---------------
  40. {:cls}                                      * Clear the screen
  41.         {SEND ^L}
  42.         {RETURN}
  43.  
  44. {:press_any_key}                            * Pause until a key is pressed
  45.         {SEND ^J^MPress Any Key:}
  46.         {SETG %inact_time,time_out}
  47.         {GETS-H temp,1,PK}
  48. {:PK}   {setv temp}
  49.         {SEND ^J^M}
  50.         {RETURN}
  51.  
  52. {:dsp_file}                                 * Display a file
  53.         {IFEX %dump_file,,DF5}              * IN: %dump_file
  54.         {SETV count,0}
  55.         {ROPE %dump_file,DF3}
  56. {:DF1}  {READ dline}
  57.         {SEND ^M%dline^J^M}
  58.         {INCR count}
  59.         {COMP count,23}   {IFCO DF4}
  60.         {GOTO DF1}
  61. {:DF2}  {RCLOSE}
  62. {:DF3}  {SETV dline}
  63.         {SETV ch}
  64.         {SETV count}
  65.         {RETURN}
  66. {:DF4}  {SETV count,0}
  67.         {SEND ^MMore [Y],N,C: }
  68.         {CALL get_key}
  69.         {IFCO DF1}
  70.         {COMP ch,n}   {IFCO DF2}
  71.         {COMP ch,y}   {IFCO DF1}
  72.         {COMP ch,c}   {IFCO ,DF4}
  73.         {SETV count,26}
  74.         {GOTO DF1}
  75. {:DF5}  {SEND ^J^M^GError: File not found: %dump_file}
  76.         {CALL press_any_key}
  77.         {RETURN}
  78.  
  79. {:menu}                                     * Get menu selection
  80.         {SEND %prompt [%_tim]: }            * OUT: %ch
  81.         {SETG %inact_time,time_out}         * %ch = ~, if user hit CR at prompt
  82.         {CALL get_key}
  83.         {IFCO MN1}
  84.         {SEND ^J^M}
  85.         {COMP ch,*}   {IFCO time_out}
  86.         {GOTO MN2}
  87. {:MN1}  {SETV ch,~}
  88.         {SEND ^J^M}
  89. {:MN2}  {RETURN}
  90.  
  91. {:get_key}
  92.         {COMP hotkeys,y} {IFCO GK1}
  93.         {GETS ch,1}
  94.         {GOTO GK2}
  95. {:GK1}  {GETS-H ch,1}
  96. {:GK2}  {COMP ch}
  97.         {RETURN}
  98.  
  99. {:get_protocol}                             * Get protcol selection
  100.         {PAUS-T 2}
  101.         {CALL cls}                          * OUT: %protocol
  102.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  103.         {SEND │                    Protocols                      │^J^M}
  104.         {SEND └───────────────────────────────────────────────────┘^J^M}
  105.         {SEND                     [Y] Ymodem^J^M}
  106.         {SEND                     [G] Ymodem-G^J^M}
  107.         {SEND                     [X] Xmodem^J^M}
  108.         {SEND                     [Z] Zmodem^J^M}
  109.         {SEND                     [H] HS/Link^J^M^J^M}
  110.         {SETV prompt,Protocol:}
  111.         {CALL menu}
  112.         {COMP ch,~}   {IFCO PG2}
  113.         {COMP ch,z}   {IFCO PG1}
  114.         {COMP ch,y}   {IFCO PG1}
  115.         {COMP ch,g}   {IFCO PG1}
  116.         {COMP ch,x}   {IFCO PG1}
  117.         {COMP ch,h}   {IFCO ,PG2}
  118. {:PG1}  {SETV protocol,%ch}
  119. {:PG2}  {RETURN}
  120.  
  121. {:send_hslink}                              * HSLINK download subroutine
  122.         {SEND ^J^MStart your HS/Link download now.^J^M}
  123.         {CALL h_send}
  124.         {COMP %_err,0}
  125.         {RETURN}
  126.  
  127. {:send_zmodem}                              * ZMODEM download subroutine
  128.         {SEND ^J^MStart your Zmodem download now.^J^M}
  129.         {CALL z_send}
  130.         {COMP %_err,0}
  131.         {RETURN}
  132.  
  133. {:send_ymodem}                              * YMODEM download subroutine
  134.         {SEND ^J^MStart your Ymodem download now.^J^M}
  135.         {CALL yb_send}
  136.         {COMP %_err,0}
  137.         {RETURN}
  138.  
  139. {:send_xmodem}                              * XMODEM-1K download subroutine
  140.         {SEND ^J^MStart your Xmodem download now.^J^M}
  141.         {IFEX %pr_file,,SX1}
  142.         {CALL xk_send}
  143.         {COMP %_err,0}
  144. {:SX1}  {RETURN}
  145.  
  146. {:recv_hslink}                              * HSLINK upload subroutine
  147.         {SEND ^J^MStart your HS/Link upload now.^J^M}
  148.         {CALL h_recv}
  149.         {COMP %_err,0}
  150.         {RETURN}
  151.  
  152. {:recv_zmodem}                              * ZMODEM upload subroutine
  153.         {SEND ^J^MStart your Zmodem upload now.^J^M}
  154.         {CALL z_recv}
  155.         {COMP %_err,0}
  156.         {RETURN}
  157.  
  158. {:recv_ymodem}                              * YMODEM upload subroutine
  159.         {SEND ^J^MStart your Ymodem upload now.^J^M}
  160.         {CALL yb_recv}
  161.         {COMP %_err,0}
  162.         {RETURN}
  163.  
  164. {:recv_yg}                                  * YMODEM-G upload subroutine
  165.         {SEND ^J^MStart your Ymodem-G upload now.^J^M}
  166.         {CALL yg_recv}
  167.         {COMP %_err,0}
  168.         {RETURN}
  169.  
  170. {:recv_xmodem}                              * XMODEM-1K upload subroutine
  171.         {SEND ^J^MStart your Xmodem upload now.^J^M}
  172.         {CALL xc_recv}
  173.         {COMP %_err,0}
  174.         {RETURN}
  175.  
  176. {:transfer_file}                            * Transfer a file upload & download
  177.         {PUSH DL2}
  178.         {COMP proto,sz} {IFCO send_zmodem}  * IN: %proto
  179.         {COMP proto,sy} {IFCO send_ymodem}  *   s + %protocol for downloads
  180.         {COMP proto,sg} {IFCO send_ymodem}  *   r + %protocol for uploads
  181.         {COMP proto,sx} {IFCO send_xmodem}
  182.         {COMP proto,sh} {IFCO send_hslink}
  183.         {COMP proto,rz} {IFCO recv_zmodem}
  184.         {COMP proto,ry} {IFCO recv_ymodem}
  185.         {COMP proto,rg} {IFCO recv_yg}
  186.         {COMP proto,rx} {IFCO recv_xmodem}
  187.         {COMP proto,rh} {IFCO recv_hslink}
  188.         {SEND ^J^MInvalid protocol ^J^M}
  189.         {CALL press_any_key}
  190.         {COMP proto,sz}                     * Set a bad condition for return
  191. {:DL1}  {SETV proto}
  192.         {POPS}
  193.         {RETURN}
  194. {:DL2}  {PAUS 2}
  195.         {RETURN}
  196.  
  197. {:get_name}
  198. {:GN1}  {SEND ^J^MEnter your real name: }   * Get a name from user
  199.         {SETG %inact_time,time_out}         * OUT: %lname
  200.         {GETS lname,16,GN1}
  201.         {RETURN}
  202.  
  203. {:get_password}                             * Get a password
  204.         {SETG %inact_time,time_out}
  205. {:GP1}  {GETS-P pass,8}
  206.         {RETURN}
  207.  
  208. {:time_out}                                 * Time out user
  209.         {POPS-C}                            * Clear the stack
  210.         {GOTO gby}
  211.  
  212. {:write_user}                               * Write the user file
  213.         {WOPE %datadir%%password.MHS}       * IN: %login_name
  214.         {WRIT %login_name}                  * IN: %userno
  215.         {WRIT %userno}                      * IN: %new_start
  216.         {WRIT %new_start}                   * IN: %protocol
  217.         {WRIT %protocol}
  218.         {WCLO}
  219.         {RETURN}
  220.  
  221. {:read_user}                                * Read the user file
  222.         {ROPE %datadir%%password.MHS,RU1}   * OUT: %login_name
  223.         {READ %login_name}                  * OUT: %userno
  224.         {READ %userno}                      * OUT: %new_start
  225.         {READ %new_start}                   * OUT: %protocol
  226.         {READ %protocol}
  227.         {RCLOSE}
  228. {:RU1}  {RETURN}
  229.  
  230. {:write_data}                               * Write data file
  231.         {WOPE %datadir%DATA.MHS}            * IN: %userno
  232.         {WRIT %userno}                      * IN: %mhigh
  233.         {WRIT %mhigh}
  234.         {WCLO}
  235.         {RETURN}
  236.  
  237. {:read_data}                                * Read data file
  238.         {ROPE %datadir%DATA.MHS,RD1}        * OUT: %userno
  239.         {READ %userno}                      * OUT: %mhigh
  240.         {READ %mhigh}
  241.         {RCLO}
  242. {:RD1}  {RETURN}
  243.  
  244. --------------------------------------------* Login functions -----------------
  245.  
  246. {:new_user}                                 * Get new user information
  247.         {CALL cls}                          * OUT: %login_name
  248. {:NU4}                                      * OUT: %password
  249.                                             * OUT: %userno
  250.         {SEND Welcome to the host with the most.  Enter your name and password.^J^M}
  251. {:NU0}  {CALL get_name}                     * OUT: %new_start
  252.         {SETV login_name,%lname}            * OUT: %protocol
  253.         {SETV lname}
  254.  
  255. {:NU1}  {SEND ^J^MEnter your password: }
  256.         {GETS password,8,NU0}
  257.         {IFEX %datadir%%password.MHS,,NU3}
  258.         {SEND ^J^MInvalid password, try something different.}
  259.         {GOTO NU1}
  260.  
  261. {:NU3}  {INCR userno}
  262.  
  263.         {SETV new_start,1}
  264.         {CALL get_protocol}
  265.         {SEND ^J^MSaving user information.}
  266.         {CALL write_user}
  267.         {SEND ^J^MRe-enter your name and password for verification.}
  268.         {RETURN}
  269.  
  270. {:login_user}                               * Login user
  271.         {PUSH}                              * OUT: %SUCCESS
  272.         {SETV SUCCESS}                      * OUT: %login_name
  273.         {SETV tries,0}                      * OUT: %password
  274. {:LU0}  {INCR tries}                        * OUT: %userno
  275.         {COMP tries,3}  {IFCO-G LU4}        * OUT: %new_start
  276.                                             * OUT: %protocol
  277.         {SEND ^J^Mlogin: }
  278.         {SETG %inact_time,time_out}
  279.         {GETS lname,16,LU0}
  280.  
  281.         {COMP lname,new}  {IFCO new_user}
  282.  
  283.         {SEND ^J^Mpassword: }
  284.         {CALL get_password}
  285.         {SETV password,%pass}
  286. {:LU2}  {SEND ^J^M}
  287.         {IFEX %datadir%%password.MHS,,LU0}
  288.         {CALL read_user}
  289.         {COMP login_name,%lname}
  290.         {IFCO ,LU0}
  291.  
  292.         {SETV SUCCESS,true}
  293.  
  294. {:LU4}  {SETV tries}
  295.         {SETV lname}
  296.         {SETV pass}
  297.         {POPS}
  298.         {RETURN}
  299.  
  300. --------------------------------------------* Dos functions--------------------
  301.  
  302. {:change_dir}                               * Change Dir
  303.         {SEND ^J^MCD }
  304.         {SETG %inact_time,time_out}
  305.         {GETS cd,70,CD1}
  306.         {EXEC-N CD %cd}
  307. {:CD1}  {SETV cd}
  308.         {RETURN}
  309.  
  310. {:do_dir}                                   * Directory
  311.         {CALL cls}
  312.         {SEND ^J^MDIR }
  313.         {SETG %inact_time,time_out}
  314.         {GETS dir,70}
  315.         {EXEC-N DIR %dir > %datadir%DIR.TMP}
  316.         {SETV dump_file,%datadir%DIR.TMP}
  317.         {CALL dsp_file}
  318.         {CALL press_any_key}
  319.         {SETV dir}
  320.         {RETURN}
  321.  
  322. {:type_file}                                * Type a file
  323.         {CALL cls}
  324.         {SEND ^J^MTYPE }
  325.         {SETG %inact_time,time_out}
  326.         {GETS type,70,TF1}
  327.         {SEND ^J^M}
  328.         {SETV dump_file,%type}
  329.         {CALL dsp_file}
  330.         {CALL press_any_key}
  331. {:TF1}  {SETV type}
  332.         {RETURN}
  333.  
  334. {:erase_file}                               * Erase a file
  335.         {SEND ^J^M^J^M(CR to abort)}
  336.         {SEND ^J^MERASE }
  337.         {SETG %inact_time,time_out}
  338.         {GETS erase,70,EF1}
  339.         {COMP erase,*.*}
  340.         {IFCO ,EF4}
  341.         {SEND ^J^M*.* not allowed!}
  342.         {CALL press_any_key}
  343.         {GOTO EF1}
  344. {:EF4}  {IFEX %erase,,EF2}
  345.         {SEND ^J^MErase %erase (Y/N): }
  346. {:EF3}  {CALL get_key}
  347.         {IFCO EF3}
  348.         {COMP ch,y} {IFCO ,erase_file}
  349.         {EXEC-N ERASE %erase > nul}
  350.         {GOTO EF1}
  351. {:EF2}  {SEND ^J^MFile not found.}
  352.         {GOTO erase_file}
  353. {:EF1}  {SETV erase}
  354.         {RETURN}
  355.  
  356. {:copy_file}                                * Copy a file
  357.         {SEND ^J^MCOPY }
  358.         {SETG %inact_time,time_out}
  359.         {GETS copy,70,CF1}
  360.         {EXEC-N COPY %copy > nul}
  361. {:CF1}  {SETV copy}
  362.         {RETURN}
  363.  
  364. {:rename_file}                              * Rename a file
  365.         {SEND ^J^MREN }
  366.         {SETG %inact_time,time_out}
  367.         {GETS ren,70,RF1}
  368.         {EXEC-N REN %ren > nul}
  369. {:RF1}  {SETV ren}
  370.         {RETURN}
  371.  
  372. {:exit_to_dos}                              * Exit to dos with DOORWAY.EXE
  373.         {COMP mspeed,local}
  374.         {IFCO EX1}
  375.         {EXEC-S DOORWAY PORT:%_pad:%_irq /M:60 /G:ON /A:ON /V:D^U /O:T /S:* /C:DOS}
  376.         {GOTO EX2}
  377. {:EX1}  {SHELL}
  378. {:EX2}  {RETURN}
  379.  
  380. {:dos_download}                             * Download a file
  381.         {SETV proto}                        * IN: %protocol
  382.         {COMP protocol,}
  383.         {IFCO ,DD1}
  384.         {CALL get_protocol}
  385. {:DD1}  {SEND ^J^MFile: }
  386.         {SETG %inact_time,time_out}
  387.         {GETS pr_file,70,DD2}
  388.         {SETV proto,s%protocol}
  389.         {SETV save_filedir,%filedir}
  390.         {SETV filedir}
  391.         {CALL transfer_file}
  392.         {CALL cls}
  393.         {SETV filedir,%save_filedir}
  394.         {SETV save_filedir}
  395.         {IFCO DD2}
  396.         {SEND ^J^MUnsuccessfull download}
  397.         {CALL press_any_key}
  398. {:DD2}  {SETV pr_file}
  399.         {RETURN}
  400.  
  401. {:dos_upload}                               * Upload a file
  402.         {SETV proto}                        * IN: %protocol
  403.         {COMP protocol,}
  404.         {IFCO ,DU1}
  405.         {CALL get_protocol}
  406. {:DU1}  {COMP protocol,x}
  407.         {IFCO ,DU2}
  408.         {SEND ^J^MFile: }
  409.         {SETG %inact_time,time_out}
  410.         {GETS pr_file,70,DU3}
  411. {:DU2}  {SETV proto,r%protocol}
  412.         {SETV save_filedir,%filedir}
  413.         {SETV filedir}
  414.         {CALL transfer_file}
  415.         {CALL cls}
  416.         {SETV filedir,%save_filedir}
  417.         {SETV save_filedir}
  418.         {IFCO DU3}
  419.         {SEND ^J^MUnsuccessfull upload}
  420.         {CALL press_any_key}
  421. {:DU3}  {SETV pr_file}
  422.         {RETURN}
  423.  
  424. {:log_drive}                                * Log a drive
  425.         {SEND ^J^MChange to which drive (A:, B:, C:, etc): }
  426.         {SETG %inact_time,time_out}
  427.         {GETS log,2,LD2}
  428. {:LD1}  {SEND ^J^MChange to drive %log (Y/N)? }
  429.         {SETG %inact_time,time_out}
  430.         {CALL get_key}
  431.         {IFCO LD1}
  432.         {COMP ch,n}  {IFCO LD2}
  433.         {COMP ch,y}  {IFCO ,LD1}
  434.         {EXEC-N %log}
  435. {:LD2}  {SETV log}
  436.         {RETURN}
  437.  
  438. {:dos_stuff}                                * Dos Menu
  439.         {SEND ^J^MDos password: }
  440.         {CALL get_password}
  441.         {COMP pass,%dospassword}
  442.         {IFCO ,DS3}
  443.         {PUSH}
  444. {:DS1}
  445.         {PAUS-T 2}
  446.         {CALL cls}
  447.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  448.         {SEND │                   DOS Commands                    │^J^M}
  449.         {SEND └───────────────────────────────────────────────────┘^J^M}
  450.         {SEND  [A] Log New Drive^J^M}
  451.         {SEND  [C] Change Dir       [U] Upload to current dir^J^M}
  452.         {SEND  [D] Directory        [V] Download from current dir^J^M}
  453.         {SEND  [E] Erase File^J^M}
  454.         {SEND  [K] Copy File        [Z] Run DOORWAY program (shell^J^M}
  455.         {SEND  [T] Type File            to DOS in local mode)^J^M}
  456.         {SEND  [R] Rename File^J^M^J^M}
  457.         {SETV prompt,DOS (CR to return)}
  458.         {CALL menu}
  459.  
  460.         {COMP ch,~}   {IFCO DS2}
  461.         {COMP ch,a}   {IFCO log_drive}
  462.         {COMP ch,c}   {IFCO change_dir}
  463.         {COMP ch,d}   {IFCO do_dir}
  464.         {COMP ch,e}   {IFCO erase_file}
  465.         {COMP ch,k}   {IFCO copy_file}
  466.         {COMP ch,r}   {IFCO rename_file}
  467.         {COMP ch,t}   {IFCO type_file}
  468.         {COMP ch,u}   {IFCO dos_upload}
  469.         {COMP ch,v}   {IFCO dos_download}
  470.         {COMP ch,z}   {IFCO exit_to_dos}
  471.  
  472.         {GOTO DS1}
  473. {:DS2}  {POPS}
  474. {:DS3}  {SETV pass}
  475.         {SETV prompt}
  476.         {RETURN}
  477.  
  478. --------------------------------------------* Xfer functions-------------------
  479.  
  480. {:dfiles}                                   * Download a file
  481.         {SETV proto}                        * IN/OUT: %protocol
  482.         {COMP protocol,}
  483.         {IFCO ,DX1}
  484.         {CALL get_protocol}
  485. {:DX1}  {SEND ^J^MFile: }
  486.         {SETG %inact_time,time_out}
  487.         {GETS pr_file,70,DX2}
  488.         {SETV pr_file,%filedir%%pr_file}
  489.         {SETV proto,s%protocol}
  490.         {CALL transfer_file}
  491.         {CALL cls}
  492.         {IFCO DX2}
  493.         {SEND ^J^MUnsuccessfull download}
  494.         {CALL press_any_key}
  495. {:DX2}  {SETV pr_file}
  496.         {RETURN}
  497.  
  498. {:ufiles}                                   * Upload a file
  499.         {SETV proto}                        * IN/OUT: %protocol
  500.         {SETV pr_file,%filedir}
  501.         {COMP protocol,}
  502.         {IFCO ,UF1}
  503.         {CALL get_protocol}
  504. {:UF1}  {COMP protocol,x}
  505.         {IFCO ,UF2}
  506.         {SEND ^J^MFile: }
  507.         {SETG %inact_time,time_out}
  508.         {GETS dfiles,70,UF3}
  509.         {SETV pr_file,%pr_file%%dfiles}
  510.         {IFEX %pr_file,,UF2}
  511.         {SEND ^J^MFile already exists!^J^M}
  512.         {CALL Press_Any_Key}
  513.         {GOTO UF3}
  514. {:UF2}  {SETV proto,r%protocol}
  515.         {CALL transfer_file}
  516.         {CALL cls}
  517.         {IFCO UF3}
  518.         {SEND ^J^MUnsuccessfull upload}
  519.         {CALL press_any_key}
  520. {:UF3}  {SETV pr_file}
  521.         {SETV dfiles}
  522.         {RETURN}
  523.  
  524. -------------------------------------------------------------------------------
  525.  
  526. {:chat}                                      * Chat w/word wrap
  527.         {SETG inact_time,time_out}
  528.         {BEEP} {BEEP} {BEEP}
  529.         {SETV chatc,3}
  530.         {SEND ^J^M^J^M(Type 'bye' to exit chat mode)^J^M}
  531.         {SEND ^J^M1> Hi %login_name, what's up?}
  532.         {SEND ^J^M2>}
  533. {:CT1}  {SETV chatl}
  534. {:CT2}  {SEND ^J^M%chatc> %chatl}
  535.         {INCR chatc}
  536.         {GETS-AH chatl,70}
  537.         {COMP chatl,bye}  {IFCO CT5}
  538.         {LENGTH %chatl}
  539.         {COMP %_len,69}  {IFCO-LE CT1}
  540.         {SETV x,71}
  541. {:CT3}  {DECR x}
  542.         {COMP x,50}  {IFCO-LE CT1}
  543.         {SUBS ch,%x,1,%chatl}
  544.         {COMP ch, }       {IFCO ,CT3}
  545.         {INCR x}
  546.         {SUBS chatl,%x,255,%chatl}
  547. {:CT4}  {COMP x,%_len}  {IFCO-G CT2}
  548.         {SEND ^H ^H}
  549.         {INCR x}
  550.         {GOTO CT4}
  551. {:CT5}  {RETURN}
  552.  
  553. -------------------------------------------------------------------------------
  554.  
  555. {:time_online}                              * Elapsed time
  556.         {SEND ^J^MTime online: %_elap^J^M}
  557.         {CALL Press_Any_Key}
  558.         {RETURN}
  559.  
  560. --------------------------------------------* User info------------------------
  561.  
  562. {:chg_name}                                 * Get new login name
  563.         {SEND ^J^M}                         * OUT: %lname
  564. {:CN1}  {CALL get_name}
  565.         {RETURN}
  566.  
  567. {:chg_password}                             * Get new password
  568.         {SEND ^J^M}                         * OUT: %pass
  569. {:CP1}  {SEND ^J^MNew password: }
  570.         {SETG %inact_time,time_out}
  571.         {GETS pass,8,CP1}
  572.  
  573.         {COMP pass,%password}   {IFCO CP2}
  574.  
  575.         {IFEX %datadir%%pass.MHS,,CP2}
  576.         {SEND ^J^MInvalid password, try again.}
  577.         {GOTO CP1}
  578.  
  579. {:CP2}  {RETURN}
  580.  
  581. {:chg_protocol}                             * Get new protocol
  582.         {CALL cls}                          * OUT: %protocol
  583.         {CALL get_protocol}
  584.         {RETURN}
  585.  
  586. {:save_user}                                * Save new information
  587.         {SEND ^J^MSaving}                   * IN: %lname,%pass,%protocol
  588.         {IFEX %datadir%%password.MHS,,SU1}  * OUT: %login_name,%password
  589.         {EXEC-N DEL %datadir%%password.MHS} * OUT: %new_start,%uport
  590. {:SU1}  {SETV login_name,%lname}
  591.         {SETV password,%pass}
  592.         {SETV uprot,%protocol}
  593.         {CALL write_user}
  594.         {RETURN}
  595.  
  596. {:fil_dir}
  597.         {EXEC-N DIR %filedir%*.* > %datadir%DIR.TMP}
  598.         {SETV dump_file,%datadir%DIR.TMP}
  599.         {CALL dsp_file}
  600.         {CALL press_any_key}
  601.         {RETURN}
  602.  
  603. {:update_info}                              * User info menu
  604.         {SETV lname,%login_name}
  605.         {SETV pass,%password}
  606.         {SETV uprot,%protocol}
  607.         {PUSH}
  608. {:UI1}  {CALL cls}
  609.         {SEND ^J^M}
  610.         {SEND ^J^M1.  User name: %lname}
  611.         {SEND ^J^M2.   Password: %pass}
  612.         {SEND ^J^M3.   Protocol: %protocol}
  613.         {SEND ^J^M}
  614.         {SEND ^J^MCommand (CR to return) [%_tim]: }
  615.         {SETG %inact_time,time_out}
  616.         {CALL get_key}
  617.         {IFCO UI2}
  618.  
  619.         {COMP ch,1}  {IFCO chg_name}
  620.         {COMP ch,2}  {IFCO chg_password}
  621.         {COMP ch,3}  {IFCO chg_protocol}
  622.         {GOTO UI1}
  623.  
  624. {:UI2}  {SEND ^J^MSave changes (Y/N)? }
  625.         {CALL get_key}
  626.         {IFCO UI3}
  627.         {COMP ch,n} {IFCO UI3}
  628.         {COMP ch,y} {IFCO ,UI2}
  629.         {CALL save_user}
  630. {:UI3}  {POPS}
  631.         {SETV ch}
  632.         {SETV lname}
  633.         {SETV pass}
  634.         {SETV protocol,%uprot}
  635.         {RETURN}
  636.  
  637. -------------------------------------------------------------------------------
  638.  
  639. {:main_menu}                                * Main menu
  640.         {PUSH}
  641. {:MM1}
  642.         {PAUS-T 2}
  643.         {CALL cls}
  644.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  645.         {SEND │                    Main Menu                      │^J^M}
  646.         {SEND └───────────────────────────────────────────────────┘^J^M}
  647.         {SEND       [D] Download Files        [T] Time online^J^M}
  648.         {SEND       [U] Upload Files          [G] Goodbye^J^M}
  649.         {SEND       [F] File List             [S] DOS Menu^J^M}
  650.         {SEND       [C] Chat                  [I] User Info^J^M}
  651.         {SEND       [P] Protocol (%protocol)^J^M^J^M}
  652.         {SETV prompt,Main Menu}
  653.         {CALL menu}
  654.  
  655.         {COMP ch,c}   {IFCO chat}
  656.         {COMP ch,f}   {IFCO fil_dir}
  657.         {COMP ch,s}   {IFCO dos_stuff}
  658.         {COMP ch,g}   {IFCO MM3}
  659.         {COMP ch,t}   {IFCO time_online}
  660.         {COMP ch,i}   {IFCO update_info}
  661.         {COMP ch,d}   {IFCO dfiles}
  662.         {COMP ch,p}   {IFCO get_protocol}
  663.         {COMP ch,u}   {IFCO ufiles}
  664.         {GOTO MM1}
  665.  
  666. {:MM3}  {SEND ^J^MAre you sure (Y/N)? }
  667.         {CALL get_key}
  668.         {IFCO MM1}
  669.         {COMP ch,y}   {IFCO ,MM1}
  670.  
  671. {:MM2}  {POPS}
  672.         {RETURN}
  673.  
  674. --------------------------------------------* Waiting for a call funcs--------
  675.  
  676. {:view_scroll}
  677.         {SCROLL}
  678.         {GOTO wait_for_call}
  679.  
  680. {:shell_dos}
  681.         {SHELL}
  682.         {GOTO wait_for_call}
  683.  
  684. {:wait_for_call}
  685.         {SPOC n}
  686.         {CLEAR}
  687.         {DISP 1,29,4E,      HOST MODE      }
  688.  
  689.         {DISP 3,29,0E,The Host with the Most}
  690.         {DISP 4,29,0E,   By Shad Muegge}
  691.         {DISP 8,29,0E,  1 - Login locally}
  692.         {DISP 9,29,0E,  2 - View Scrollback}
  693.         {DISP 10,29,0E,  3 - Shell to DOS}
  694.         {DISP 11,29,0E,  Q - Quit}
  695.  
  696.         {DISP 22,1,0E,  Last user: %login_name (%mspeed)}
  697.  
  698.         {DISP 24,29,4e, Waiting for a Call }
  699.         {DISP 20,1,,                               }
  700.         {DISP 20,1,0E,  Command: }
  701.         {SETG 0,,l}
  702. {:WF1}  {GETS mring,10,WF1}
  703.         {DISP 24,29,07,                    }
  704.         {COMP mring,1}              {IFCO WF4}
  705.         {COMP mring,2}              {IFCO view_scroll}
  706.         {COMP mring,3}              {IFCO shell_dos}
  707.         {COMP mring,q}              {IFCO WF5}
  708.         {COMP mring,%ring_string}   {IFCO ,Wait_for_call}
  709.  
  710.         {SPOC y}
  711.         {DISP 24,29}
  712.         {SEND ~ATA^M~}
  713.  
  714.         {SETL 45,wait_for_call}
  715.         {DISP 20,1,7,  Waiting for connect: }
  716.         {COMP autobaud,y}   {IFCO WF2}
  717.         {LOOK %connect_string}
  718.         {PAUS 1}
  719.         {RETURN}
  720.  
  721. {:WF2}  {GOLO C012,%connect_string 1200^M}
  722.         {GOLO C024,%connect_string 2400^M}
  723.         {GOLO C048,%connect_string 4800^M}
  724.         {GOLO C096,%connect_string 9600^M}
  725.         {GOLO C192,%connect_string 19200^M}
  726.         {GOLO C384,%connect_string 38400^M}
  727.         {GOLO C576,%connect_string 57600^M}
  728.         {LOOK %connect_string^M}
  729.         {SETV mspeed,300}
  730.         {GOTO WF3}
  731.  
  732. {:C012} {SETV mspeed,1200}  {GOTO WF3}
  733. {:C024} {SETV mspeed,2400}  {GOTO WF3}
  734. {:C048} {SETV mspeed,4800}  {GOTO WF3}
  735. {:C096} {SETV mspeed,9600}  {GOTO WF3}
  736. {:C192} {SETV mspeed,19200} {GOTO WF3}
  737. {:C384} {SETV mspeed,38400} {GOTO WF3}
  738. {:C576} {SETV mspeed,57600}
  739.  
  740. {:WF3}  {PARM %mspeed}
  741.         {PAUS 1}
  742.         {RETURN}
  743.  
  744. {:WF4}  {SETV mspeed,LOCAL}
  745.         {local y}
  746.         {SPOC n}
  747.         {RETURN}
  748.  
  749. {:WF5}  {CLEAR}
  750.      Clean up variables
  751.  
  752.         {SETV userno}     {SETV mring}      {SETV filedir}   {SETV mspeed}
  753.         {SETV new_start}  {SETV login_name} {SETV password}  {SETV dump_file}
  754.         {SETV password}   {SETV protocol}   {SETV prompt}    {SETV ch}
  755.         {SETV datadir}    {SETV dospassw}   {SETV protodir}  {SETV autobaud}
  756.         {SETV mhigh}      {SETV chatc}      {SETV chatl}     {SETV x}
  757.         {SETV inact_time} {SETV proto}      {SETV uprot}     {SETV hotkeys}
  758.         {SETV connect_string}  {SETV attention_string}  {SETV ring_string}
  759.  
  760.         {LOCA n}
  761.         {UNLOad}
  762.  
  763. --------------------------------------------* Main BBS loop ------------------
  764.  
  765. {:BBS}
  766.         {CALL setup}
  767.         {CALL Wait_For_Call}
  768.  
  769.         {CALL cls}
  770.         {SETV userno}
  771.         {SEND ^J^M                                  HOST MODE^J^M^J}
  772.         {SEND                        Written in ^(COMMO^) macro language^J^M^J^J}
  773.         {SEND New users type 'NEW'^J^M^J^M}
  774.         {CALL read_data}
  775.         {CALL login_user}
  776.  
  777.         {COMP success,TRUE}
  778.         {IFCO ,gby}
  779.  
  780. {:BB0}  {ELAP}
  781.         {CALL main_menu}
  782.  
  783. {:gby}
  784.         {SEND ^J^M^JThanks for calling...^J^M}
  785.         {HANG y}
  786.         {COMP success,TRUE}
  787.         {IFCO ,hng}
  788.         {SEND Saving}
  789.         {CALL write_user}
  790.         {CALL write_data}
  791. {:hng}  {SETV success}
  792.         {GOTO BBS}
  793.  
  794.                                 - end -
  795.